package cn.net.yugu.doraemon.common.dal.entity;

import java.io.Serializable;
import java.time.Instant;

import lombok.Data;

/**
 * @author xiangzhurui
 * @version 2023/2/19 22:25:50
 */
@Data
public abstract class BaseEntity implements Serializable {

    private static final long serialVersionUID = -7043613893273684863L;

    protected Instant createdAt;

    protected Instant updatedAt;

    public void setCreatedDefaultValue() {
        createdAt = Instant.now();
    }

    public void setUpdatedDefaultValue() {
        updatedAt = Instant.now();
    }

}
